﻿using Parylene_CVD.Model.DModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Parylene_CVD.DAL
{
    public class RecordDAL : BaseDAL<Record>
    {
        public List<Record> GetAllRecord()
        {
            return GetModelList("");
        }

        public List<Record> GetRecord(string strWhere, string strCols)
        {
            return GetModelList(strWhere, strCols, null);
        }

        public int AddRecord(Record Record, string strCols)
        {
            int a = Add(Record, strCols, 0);
            return a;
        }

        public bool AddListRecord(List<Record> Records, string strCols)
        {
            bool a = AddList(Records, strCols);
            return a;
        }

        public bool UpdataRecord(Record Record, string strCols)
        {
            return Update(Record, strCols);
        }
        public bool UpdataRecord(Record Record, string strCols, string strWhere)
        {
            return Update(Record, strCols, strWhere, null);
        }
        public bool UpdataListRecord(List<Record> Records, string strCols)
        {
            return UpdateList(Records, strCols);
        }

        public bool DeleteRecordByID(object id)
        {
            return Delete(id);
        }

        public bool DeleteRecord(string strWhere)
        {
            return Delete(strWhere, null);
        }

        public bool DeleteListRecordByID(List<object> idList)
        {
            return DeleteList(idList);
        }
    }
}

